//
//  BusWebService.h
//  Bus_iPhone
//
//  Created by 修勇 黄 on 12-7-19.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ASIFormDataRequest.h"
#import "ASINetworkQueue.h"

#define kRequesetURL        @"http://www.chabus.cn/index.php"

@protocol BusFileDownLoadDelegate <NSObject>

@optional

-(void)busFileDownFailed:(ASIHTTPRequest *)downRequest error:(NSError *)error;

-(void)busFileDownSuccess:(ASIHTTPRequest *)downRequest;

-(void)busFileAllDownLoad;

@end

@interface BusWebService : NSObject<ASIHTTPRequestDelegate>{

    ASINetworkQueue *busDownFileQueue;
}

@property (nonatomic,assign)id<BusFileDownLoadDelegate>delegate;

-(NSInteger)checkNetWork;//0 无网络 1 wifi  2 3G

-(ASIFormDataRequest *)postRequestWithDic:(NSDictionary *)dic;

//down file

-(BOOL)addDwonLoadFileWithHost:(NSString *)host fileName:(NSString *)fileName progress:(id)progress;

-(void)clearAllProgress;

-(BOOL)cancelDownLoadFileByHost:(NSString *)host;

-(BOOL)addProgressDelegate:(id)progress host:(NSString *)host;

-(BOOL)addProgressDelegate:(id)progress name:(NSString *)name;

-(BOOL)checkIsHadDownByHost:(NSString *)host;

-(BOOL)checkIShadDownByName:(NSString *)name;
@end
